package com.waniu;


import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@EnableConfigurationProperties(PersonProperties.class)
@Configuration
public class AutoConfiguration {

    @Bean
    public Person initPerson(PersonProperties properties) {
        return Person.builder()
                .username(properties.getUsername() + "!!!")
                .age(properties.getAge())
                .birth(properties.getBirth())
                .build();
    }
}
